﻿// Unicode.cs
//
// Copyright 2008 by Burt Harris
// Licensed under the Microsoft Public License (Ms-PL)
// See: http://www.codeplex.com/yaml/license
//

namespace YaTools.Yaml
{
    // YamlStream character code constants
    // ReSharper disable InconsistentNaming
    internal static class Unicode
    {
        public const char NUL = (char) 0;
        public const char Space = ' ';
        public const char SingleQuote = '\'';
        public const char DoubleQuote = '"';
        public const char CR = '\r';
        public const char LF = '\n';
        public const char Tab = '\t';
        public const char Backslash = '\\';
        public const char Slash = '/';
        public const char Escape = (char) 0x1b;
        public const char NEL = (char) 0x85;
        public const char NBS = (char) 0xa0;
        public const char LS = (char) 0x2028;
        public const char PS = (char) 0x2029;
        public const char BOM = (char) 0xfffe;
        public const char EOS = (char) 0xffff;

        public static bool IsBreak(char ch)
        {
            switch (ch)
            {
                case LF:
                case CR:
                case NEL:
                case LS:
                case PS:
                    return true;
            }
            return false;
        }

        // ReSharper restore InconsistentNaming
    }
}